home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ETO Development Tools 4
/
ETO Development Tools 4.iso
/
Tools - Objects
/
MacApp
/
MacApp 3.0a2
/
Libraries
/
UViewBehavior.cp
< prev
next >
Wrap
Text File
|
1991-05-01
|
4KB
|
146 lines
////////////////////////////////////////////////////////////////////////////
// UViewBehavior.cp
//
// Contains: Implementation for View Behavior abstract class
//
// Copyright 1984-1991 Apple Computer, Inc.All rights reserved.
//
// Change History:
//
// 3/1/91 rtm Initial creation of file
//
////////////////////////////////////////////////////////////////////////////
#ifndef __UGEOMETRY__
#include <UGeometry.h>
#endif
#ifndef __UMACAPPUTILITIES__
#include <UMacAppUtilities.h>
#endif
#ifndef __UERRORMGR__
#include <UErrorMgr.h>
#endif
#ifndef __UMACAPPGLOBALS__
#include <UMacAppGlobals.h>
#endif
#ifndef __UBEHAVIOR__
#include <UBehavior.h>
#endif
#ifndef __UVIEW__
#include <UView.h>
#endif
#ifndef __UVIEWBEHAVIOR__
#include <UViewBehavior.h>
#endif
// •••••••••••••••••••••••••••••••••••••••••••••••••
// • TViewBehavior •
// •••••••••••••••••••••••••••••••••••••••••••••••••
//--------------------------------------------------------------------------------------------------
#pragma segment MAOpen
pascal void TViewBehavior::Initialize ( void ) // OVERRIDE
{
inherited::Initialize();
fActive = false;
} // <- Initialize
//--------------------------------------------------------------------------------------------------
#pragma segment MAOpen
pascal void TViewBehavior::IViewBehavior ( void )
{
this->IBehavior ();
} // <- IViewBehavior
//--------------------------------------------------------------------------------------------------
#pragma segment MAViewBehaviorNonRes
pascal void TViewBehavior::ActivateViewBehavior ( Boolean activate )
{
fActive = activate;
if ( fNextBehavior )
( ( TViewBehavior* ) fNextBehavior )->ActivateViewBehavior ( activate );
} // <- ActivateViewBehavior
//--------------------------------------------------------------------------------------------------
#pragma segment MAViewBehaviorNonRes
pascal TView* TViewBehavior::GetOwningView ( void )
{
if ( fOwner )
return ( TView* )fOwner;
else
return NULL;
} // <- GetOwningView
//--------------------------------------------------------------------------------------------------
#pragma segment MAViewBehaviorNonRes
pascal Boolean TViewBehavior::IsBehaviorActive ( void )
{
if ( fNextBehavior )
return (( TViewBehavior* ) fNextBehavior)->IsBehaviorActive ();
else
return fActive;
} // <- IsBehaviorActive
//--------------------------------------------------------------------------------------------------
#pragma segment MASelCommand
pascal Boolean TViewBehavior::DoMouseCommand ( VPoint& theMouse,
TToolboxEvent* event,
Point hysteresis )
{
if ( fNextBehavior )
return ( ( TViewBehavior* ) fNextBehavior )->DoMouseCommand ( theMouse, event, hysteresis );
else
return false;
} // <- DoMouseCommand
//--------------------------------------------------------------------------------------------------
#pragma segment MAViewBehaviorRes
pascal void TViewBehavior::Draw ( const VRect& area )
{
if ( fNextBehavior )
( ( TViewBehavior* )fNextBehavior)->Draw ( area );
} // <- BehaviorDraw
//--------------------------------------------------------------------------------------------------
#pragma segment MAViewBehaviorRes
pascal Boolean TViewBehavior::DoSetCursor ( const VPoint& localPoint,
RgnHandle cursorRgn )
{
if ( fNextBehavior )
return (( TViewBehavior* )fNextBehavior)->DoSetCursor ( localPoint, cursorRgn );
else
return false;
} // <- DoSetCursor